import request from "../utils/requset";

export const loginApi = async (userName: string, password: string) => {
  return await request.post<any, any>("/users/login", {
    userName,
    password,
  });
};
//判断数据库中是否已经存在该用户名
export const isHaveUserApi = async (userName: string) => {
  return await request.post("/users/findUserName", {
    userName,
  });
};
//注册接口
export const registerApi = async (userName: string, password: string) => {
  return await request.post("/users/register", {
    userName,
    password,
  });
};
